#!/usr/bin/env bash 
 
echo "start install maven" 

echo "开始进入解压..."
tar -zxvf /home/downloads/apache-maven-3.6.2-bin.tar.gz -C /home/downloads/ 
mv /home/downloads/apache-maven-3.6.2/ /usr/local/
mv /usr/local/apache-maven-3.6.2  /usr/local/maven3
echo "解压成功"
 
echo "开始修改/etc/profile中配置文件，增加新的内容"
cat >> /etc/profile << EOF
export M2_HOME=/usr/local/maven3
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
EOF

echo "执行cat标准输出成功,开始更新/etc/profile文件。"
source /etc/profile
echo "maven 安装成功"
echo "开始测试maven是否安装看成。看下面输出"
mvn -v


# mvn clean package docker:build
# docker login
# docker push 